﻿/*-----------------------------------------------
// File: FirstAttackState.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.View
{
    public class FirstAttackState : AttackState 
    {
        public BattleViewFirstCtrl firstViewCtrl {
            get { return battleRoundCtrl.viewCtrl as BattleViewFirstCtrl; }
        }

        public FirstAttackState(BattleRoundState state, FirstBattleRoundCtrl ctrl) : base(state, ctrl) { }

        public override void Enter()
        {
            if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillNeedFirstCast)
            {
                BattleManager.Instance.battlePanel.guidePanel.Hide();
                firstViewCtrl.curGuideStep = BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillFirstCasting;
                BattleManager.Instance.battlePanel.guidePanel.Show(null, firstViewCtrl.curGuideStep);
                FirstCheckPointUtil.CheckPoint(EnterGameCheckPointEnum.GuideFirstSkill);
            }
            else if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillNeedSecondCast)
            {
                BattleManager.Instance.battlePanel.guidePanel.Hide();
                firstViewCtrl.curGuideStep = BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillSecondCasting;
                BattleManager.Instance.battlePanel.guidePanel.Show(null, firstViewCtrl.curGuideStep);
                FirstCheckPointUtil.CheckPoint(EnterGameCheckPointEnum.GuideSecondSkill);
            }
            else if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillNeedAllCast) {
                BattleManager.Instance.battlePanel.guidePanel.Hide();
                firstViewCtrl.curGuideStep = BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillAllCasting;
                BattleManager.Instance.battlePanel.guidePanel.Show(null, firstViewCtrl.curGuideStep);
                FirstCheckPointUtil.CheckPoint(EnterGameCheckPointEnum.GuideAutoFight);
            }
        }

        public override void Leave()
        {
            if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillFirstCasting)
            {
                firstViewCtrl.curGuideStep = BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillNeedSecondCast;
            }
            else if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillSecondCasting)
            {
                firstViewCtrl.curGuideStep = BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillNeedAllCast;
            }
            else if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.NormalSkillAllCasting) {
            }
        }

    }
}
